package org.mokusakura.domain;

import java.io.Serializable;
import java.math.BigDecimal;

public class LineItem implements Serializable {

    private static final long serialVersionUID = 6804536240033522156L;

    private Long orderId;
    private Integer lineItemNumber;
    private String itemId;
    private Integer quantity;
    private BigDecimal listPrice;
    private Item item;

    public Item getItem() {
        return item;
    }

    public LineItem setItem(Item item) {
        this.item = item;
        return this;
    }

    public Integer getLineItemNumber() {
        return lineItemNumber;
    }

    public LineItem setLineItemNumber(Integer lineItemNumber) {
        this.lineItemNumber = lineItemNumber;
        return this;
    }

    public Long getOrderId() {
        return orderId;
    }

    public LineItem setOrderId(Long orderId) {
        this.orderId = orderId;
        return this;
    }


    public String getItemId() {
        return itemId;
    }

    public LineItem setItemId(String itemId) {
        this.itemId = itemId;
        return this;
    }

    public Integer getQuantity() {
        return quantity;
    }

    public LineItem setQuantity(Integer quantity) {
        this.quantity = quantity;
        return this;
    }

    public BigDecimal getListPrice() {
        return listPrice;
    }

    public LineItem setListPrice(BigDecimal listPrice) {
        this.listPrice = listPrice;
        return this;
    }

    public BigDecimal getTotal() {
        return listPrice.multiply(BigDecimal.valueOf(quantity));
    }

    @Override
    public String toString() {
        return "LineItem{" +
                "orderId=" + orderId +
                ", lineItemNumber=" + lineItemNumber +
                ", itemId='" + itemId + '\'' +
                ", quantity=" + quantity +
                ", listPrice=" + listPrice +
                '}';
    }
}
